<template>
  <div class="app-container">
    <basic-table 
    :table-title="tableTitle" 
    :data-source="dataSource" 
    :button-group="buttonGroup"
    :search-form="searchForm" 
    :model-type="'visitLogs'" 
    :multiple-table="false" 
    :reload="reload"
    @closeReload="closeReload"
    >
    </basic-table>
  </div>
</template>
<script>
import BasicTable from '@/components/BasicTable/index.vue'
import { GetUserVisitLogs } from '@/api/user'
export default {
  name: 'VisitLogs',
  components: { BasicTable },
  data() {
    return {
      loading: false,
      reload: false,
      tableTitle: [
        {
          label: '用户',
          value: 'UserName',
          show: true,
          type: 'text'
        },
        {
          label: '用户来源',
          value: 'UserSource',
          show: true,
          type: 'text',
        },
        {
          label: '登录IP',
          value: 'IP',
          show: true,
          type: 'text',
        },
        {
          label: '描述',
          value: 'Description',
          show: true,
          type: 'text',
        },
        {
          label: '访问时间',
          value: 'CreateTime',
          show: true,
          type: 'text'
        }
      ],
      dataSource: () => GetUserVisitLogs,
      searchForm: {
        expend: true,
        title: '用户访问日志',
        fields: [
          {
            show: true,
            type: 'input',
            label: '用户名',
            labelShow: true,
            name: 'username'
          },
          {
            show: true,
            type: 'input',
            label: '描述',
            labelShow: true,
            name: 'description'
          },
          {
            show: true,
            type: 'datetimerange',
            label: '访问时间',
            labelShow: true,
            name: 'time'
          },
        ]
      },
      buttonGroup: {
        expend: true,
        title: '表格筛选',
        size: 'default',
        fields: [
      
        ]
      },
      reload: false,
    }
  },
  methods: {
    closeReload(val) {
      this.reload = val
    },
  }
}
</script>
